package com.foreveross.proxyip.application.pool.vo;

import java.util.HashMap;
import java.util.Map;

import com.foreveross.proxyip.core.BaseCode;
import com.foreveross.proxyip.core.redis.PiRedisExecption;
import com.foreveross.proxyip.infra.conf.PropertyUtils;
import com.foreveross.proxyip.infra.conf.proxyip.ProxyIpPropertiesLoader;
import com.foreveross.proxyip.util.Config;

public class PublicPoolVo {
	/****当前池大小****/
	Long currNum = 0L;
	/***ip最大使用次数***/
	Integer ipMaxUsedCount = 0;
	/***公共池验证ip间隔时间***/
	Integer publicIntSeparationTime = 0;
	/***线程数量***/
	Long threadCount = 0L;
	/***最小连接代理IP数***/
	Integer poolProxyMin=0;
	/***公共池存在的代理ip数***/
	Integer poolProxyMax=0;
	/***公共池检出时间间隔***/
	Integer publicOutSeparationTime=0;
	
	Integer threadMaxIpCount = 0;
	
	Map<String ,String> channels = new HashMap<String, String>();
	
	
	/***ip集合***/
	public PublicPoolVo(){
		try {
			ipMaxUsedCount = Integer.parseInt( BaseCode.getValue("PUBLIC_MAX_USED_COUNT"));
		
			publicIntSeparationTime = Integer.parseInt( BaseCode.getValue("PUBLIC_IN_SEPARATION_TIME"));
			
			threadMaxIpCount = Integer.parseInt(BaseCode.getValue("PUBLIC_THREAD_MAX_IP_COUNT"));
			
			poolProxyMin=Integer.parseInt(BaseCode.getValue("PUBLIC_PROXY_MIN"));
			
			poolProxyMax=Integer.parseInt(BaseCode.getValue("PUBLIC_PROXY_MAX"));
			
			publicOutSeparationTime=Integer.parseInt( BaseCode.getValue("PUBLIC_OUT_SEPARATION_TIME"));
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (PiRedisExecption e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

	
	
	public Long getCurrNum() {
		return currNum;
	}
	public void setCurrNum(Long currNum) {
		this.currNum = currNum;
	}
	public Integer getIpMaxUsedCount() {
		return ipMaxUsedCount;
	}
	
	public Long getThreadCount() {
		return threadCount;
	}

	public void setThreadCount(Long threadCount) {
		this.threadCount = threadCount;
	}



	public Integer getThreadMaxIpCount() {
		return threadMaxIpCount;
	}



	public void setThreadMaxIpCount(Integer threadMaxIpCount) {
		this.threadMaxIpCount = threadMaxIpCount;
	}



	public void setIpMaxUsedCount(Integer ipMaxUsedCount) {
		this.ipMaxUsedCount = ipMaxUsedCount;
	}

    


	public Map<String, String> getChannels() {
		return channels;
	}



	public void setChannels(Map<String, String> channels) {
		this.channels = channels;
	}



	public Integer getPoolProxyMin() {
		return poolProxyMin;
	}



	public void setPoolProxyMin(Integer poolProxyMin) {
		this.poolProxyMin = poolProxyMin;
	}



	public Integer getPoolProxyMax() {
		return poolProxyMax;
	}



	public void setPoolProxyMax(Integer poolProxyMax) {
		this.poolProxyMax = poolProxyMax;
	}



	public Integer getPublicIntSeparationTime() {
		return publicIntSeparationTime;
	}



	public void setPublicIntSeparationTime(Integer publicIntSeparationTime) {
		this.publicIntSeparationTime = publicIntSeparationTime;
	}



	public Integer getPublicOutSeparationTime() {
		return publicOutSeparationTime;
	}



	public void setPublicOutSeparationTime(Integer publicOutSeparationTime) {
		this.publicOutSeparationTime = publicOutSeparationTime;
	}
	
	
	
}
